<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>{$title}</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link href="/Partner/static/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="/Partner/static/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/Partner/static/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/Partner/static/css/animate.min.css" rel="stylesheet">
    <link href="/Partner/static/css/style.min.css?v=4.0.0" rel="stylesheet">
    <base target="_self">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">


    <div class="page-content" style="padding: 0;border: none;">


            <div class="panel-body" style="padding: 0;border: none;">
                <input type="hidden" name="id" value="{$current.id}" />
                <div class="tab-content" style="padding: 16px 12px 55px 12px;">
                    <div class="row panel-body">
                        <a href="{:U('users/angel',array('id'=>$_GET['id']))}" class="btn btn-sm btn-default">代言管理</a>
                        <a href="{:U('users/add_angel',array('id'=>$_GET['id']))}" class="btn btn-sm btn-default">添加代言</a>
                        <a href="javascript:;" class="btn btn-sm btn-success">编辑代言</a>

                    </div>


                    <div class="tab-pane fade active in" id="apply">
                        <section class="panel panel-default">
                            <header class="panel-heading font-bold"> 编辑代言 </header>
                            <div class="panel-body">
                                <div class="line line-dashed line-lg pull-in"></div>

                                <div class="form-group" style="width: 100%;float: left;">
                                    <label class="col-sm-2 control-label">绑定用户手机</label>
                                    <div class="col-md-3">
                                        <input type="text" class="form-control" datatype="required" data="绑定用户手机"  value="{$userinfo.phone}" readonly="readonly">
                                        <input type="hidden" id="u_id"  value="{$userinfo['id']}">
                                        <input type="hidden" id="a_id"  value="{$_GET['id']}">
                                     </div>

                                </div>


                                <div class="line line-dashed line-lg pull-in"></div>
                                <div class="form-group"style="width: 100%;float: left;">
                                    <label class="col-sm-2 control-label">代言区域</label>
                                    <div class="col-md-2">
                                        <select class="form-control m-b" name="province" id="seleAreaNext" onchange="getProvince(this,'#seleAreaThird')" <eq name="type" value="0">readonly</eq>>
                                            <option value="">请选择省</option>
                                        </select>
                                    </div>
                                    <div class="col-md-2">
                                        <select class="form-control m-b" name="city" id="seleAreaThird" onchange="getSelCity(this, '#seleAreaFouth')" <eq name="type" value="0">readonly</eq>>
                                            <option value="">请选择市</option>
                                        </select>
                                    </div>
                                    <div class="col-md-2">
                                        <select class="form-control m-b" name="district" id="seleAreaFouth" <eq name="type" value="0">readonly</eq>>
                                            <option value="-1">请选择区</option>
                                        </select>
                                    </div>

                                </div>
                                <div class="line line-dashed line-lg pull-in"></div>
                                <div class="form-group"style="width: 100%;float: left;">
                                    <label class="col-sm-2 control-label">原因</label>
                                    <div class="col-md-3">
                                        <textarea  name="reason"  id="reason"class="form-control" <eq name="type" value="0">readonly</eq>>{$rs_info.reason}</textarea>
                                       可选
                                    </div>
                                </div>




                            </div>
                        </section>


                            <div class="col-sm-4 col-sm-offset-2" style="margin-top: 10px;">
                                <button class="bchun btn  btn-sm"  value="保存"  type="button">保存</button> &nbsp; &nbsp; &nbsp;
                                <button class="btn btn-primary btn-sm btn-danger" value="取消" type="button" onclick="history.back(-1);">取消</button>
                            </div>


                        </div>

                </div>
            </div>


    </div>
    <input type="hidden" id="company_province_id" value="{$rs_info.province_id}">
    <input type="hidden" id="company_city_id" value="{$rs_info.city_id}">
    <input type="hidden" id="company_district_id" value="{$rs_info.district_id}">
</div>


<script src="/Partner/static/js/jquery.min.js?v=2.1.4"></script>
<script src="/Partner/static/js/bootstrap.min.js?v=3.3.5"></script>
<script src="/Partner/static/js/content.min.js?v=1.0.0"></script>
<script src="/Partner/static/js/plugins/iCheck/icheck.min.js"></script>


<script src="/static/js/layer2.1/layer.js"></script>
<script type="text/javascript" src="/NewAdmin/js/common.js"></script>
<script type="text/javascript" src="/NewAdmin/js/main.js"></script>



<script>
    //全局变量
    var GV = {
        DIMAUB: "/",
        JS_ROOT: "NewAdmin/js/",
        TOKEN: ""
    };
</script>
<script type="text/javascript" src="/NewAdmin/js/webuploader/webuploader.js"></script>
<script type="text/javascript" src="/NewAdmin/js/webuploader/getting-started.js"></script>
<link rel="stylesheet" href="/NewAdmin/css/webuploader.css" />
<script src="/NewAdmin/js/wind.js"></script>
<link href="/NewAdmin/js/artDialog/skins/default.css" rel="stylesheet" />
<script src="/NewAdmin/js/zhlmy.js"></script>
<script src="/NewAdmin/js/init_address.js"></script>
<script type="text/javascript">

    $(function() {
        if($("#company_province_id").val() == null) {
            provice_id = 0;
        } else {
            provice_id = $("#company_province_id").val();
        }
        if($("#company_city_id").val() == null) {
            city_id = -1;
        } else {
            city_id = $("#company_city_id").val();
        }
        if($("#company_district_id").val() == null) {
            district_id = -1;
        } else {
            district_id = $("#company_district_id").val();
        }

        if(provice_id == 0) {
            initProvince('#seleAreaNext');
        } else {
            load('province', provice_id, 'city', city_id, 'district', district_id);
        }
        $(function () {
            $('.bchun').click(function () {
                 var u_id=$('#u_id').val();
                 var a_id=$('#a_id').val();
                 var seleAreaNext=$('#seleAreaNext').val();
                 var seleAreaThird=$('#seleAreaThird').val();
                 var seleAreaFouth=$('#seleAreaFouth').val();
                 var reason=$('#reason').val();
                 if(seleAreaNext<1){
                     layer.msg('请选择区域');
                     return;
                 }
                $.ajax({
                    type: "post",
                    url: "{:U('users/edit_angel_post')}",
                    data: {
                        'id': a_id,
                        'u_id': u_id,
                        'seleAreaNext': seleAreaNext,
                        'seleAreaThird':seleAreaThird,
                        'seleAreaFouth':seleAreaFouth,
                        'reason':reason
                     },
                    success: function(data) {
                        if(data==1){
                            layer.msg('编辑成功');
                            //setTimeout("location.reload()",1000);
                        }
                        if(data==0){
                            layer.msg('无数据更新');
                        }
                        if(data==2){
                            layer.msg('该区域已存在');
                        }
                    }
                });
            })
        })

    });
</script>






</body>

</html>